package command;

public class SimpleTouchCommand implements Command {

	private TouchType action;
	private float x = -1;
	private float y = -1;
	private int key = 0x10;

	public static enum TouchType {
		MOVE(102), RELEASE(103), PRESS(101);
		TouchType(int i){
			this.type = i;
		}
		public int getType(){
			return type;
		}
		private final int type;
	}
	
	public SimpleTouchCommand(TouchType action,int key,float x, float y) {
		this.action = action;
		this.key = key;
		this.x = x;
		this.y = y;
	}

	@Override
	public String toString() {
		return action.name() + ":" + (int)getX() + "," + (int)getY() + "\n";
	}

	public String toXmlString() {
		return null;
	}

	public TouchType getAction() {
		return action;
	}

	public float getX() {
		return x;
	}

	public float getY() {
		return y;
	}
	
	@Override
	public int getType() {
		return action.getType();
	}

	public int getKey() {
		return key;
	}

}
